CSharpTest.Net
TryAdd Method
See Also  Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Collections Namespace > IDictionaryEx<TKey,TValue> Interface : TryAdd Method

key
The object to use as the key of the element to add.
value
The object to use as the value of the element to add.

Glossary Item Box

Adds an element with the provided key and value to the IDictionary.

Syntax

Visual Basic (Declaration) 
Function TryAdd( _
   ByVal key As TKey, _
   ByVal value As TValue _
) As Boolean
C# 
bool TryAdd( 
   TKey key,
   TValue value
)

Parameters

key
The object to use as the key of the element to add.
value
The object to use as the value of the element to add.

Exceptions

ExceptionDescription
System.NotSupportedExceptionThe IDictionary is read-only.

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys